package com.bi.design.pojo;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.bi.design.consts.TimeConsts;
import java.text.SimpleDateFormat;
import java.time.LocalDate;
import java.util.Objects;

public class TimeQuery {
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private LocalDate searchTime;

    public String getSearchTime() {
        if (Objects.nonNull(searchTime)) {
            return new SimpleDateFormat(TimeConsts.DATE_FORMATTER_DATE).format(searchTime);
        }
        return null;
    }

    public void setSearchTime(LocalDate searchTime) {
        this.searchTime = searchTime;
    }

    @Override
    public String toString() {
        return "TimeQuery{" +
                "searchTime=" + searchTime +
                '}';
    }
}
